From 16848d6da27140caf922f71a233f96a508fb061e Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sun, 24 Jan 2021 12:38:37 +0100
Subject: [PATCH] CMakeLists.txt: add BUILD_BENCHMARKS

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/libgeos/geos/pull/395]
---
 CMakeLists.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8b39bac..8ca6b829 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,6 +48,7 @@ option(BUILD_SHARED_LIBS "Build GEOS with shared libraries" ON)
 set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard version to use (default is 11)")
 
 ## GEOS custom variables
+option(BUILD_BENCHMARKS "Build GEOS benchmarks" ON)
 cmake_dependent_option(GEOS_BUILD_DEVELOPER
   "Build with compilation flags useful for development" ON
   "GEOS_BUILD_FROM_GIT" OFF)
@@ -292,7 +293,9 @@ endif()
 #-----------------------------------------------------------------------------
 # Benchmarks
 #-----------------------------------------------------------------------------
-add_subdirectory(benchmarks)
+if(BUILD_BENCHMARKS)
+  add_subdirectory(benchmarks)
+endif()
 
 #-----------------------------------------------------------------------------
 # Utils
-- 
2.29.2

